home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cchh01.arc / NRO.H < prev    next >
Text File  |  1986-03-14  |  8KB  |  180 lines

  1.  
  2. /*
  3.  *      Parameter file for NRO word processor
  4.  *
  5.  *      Stephen L. Browning
  6.  *      5723 North Parker Avenue
  7.  *      Indianapolis, Indiana 46220
  8.  */
  9.  
  10.  
  11. /* some or all of this may be unnecessary for you */
  12.  
  13. /* #include <ctype.h> */
  14. #define EOS '\0'
  15. #define CPMEOF 0x1a
  16. #define TRUE -1
  17. #define FALSE 0
  18. #define OK 0
  19.  
  20. /* end of possible bogus hacks */
  21.  
  22. #define MACRO    0      /* macro definition */
  23. #define BP       1      /* begin page   */
  24. #define BR       2      /* break        */
  25. #define CE       3      /* center       */
  26. #define FI       4      /* fill         */
  27. #define FO       5      /* footer       */
  28. #define HE       6      /* header       */
  29. #define IN       7      /* indent       */
  30. #define LS       8      /* line spacing */
  31. #define NF       9      /* no fill      */
  32. #define PL      10      /* page lenght  */
  33. #define RM      11      /* right margin */
  34. #define SP      12      /* line space   */
  35. #define TI      13      /* temp indent  */
  36. #define UL      14      /* underline    */
  37. #define JU      15      /* justify      */
  38. #define NJ      16      /* no justify   */
  39. #define M1      17      /* top margin   */
  40. #define M2      18      /* second top margin    */
  41. #define M3      19      /* first bottom margin  */
  42. #define M4      20      /* bottom-most margin   */
  43. #define BS      21      /* allow/disallow '\b' in output */
  44. #define NE      22      /* need n lines */
  45. #define PC      23      /* page number character */
  46. #define CC      24      /* control character    */
  47. #define PO      25      /* page offset  */
  48. #define BO      26      /* bold face    */
  49. #define EH      27      /* header for even numbered pages       */
  50. #define OH      28      /* header for odd numbered pages        */
  51. #define EF      29      /* footer for even numbered pages       */
  52. #define OF      30      /* footer for odd numbered pages        */
  53. #define SO      31      /* source file  */
  54. #define CU      32      /* continuous underline */
  55. #define DE      33      /* define macro */
  56. #define EN      34      /* end macro definition */
  57. #define NR      35      /* set number register  */
  58.  
  59. #define UNKNOWN -1
  60.  
  61. /*
  62.  *      MAXLINE is set to a value slightly larger
  63.  *      than twice the longest expected input line.
  64.  *      Because of the way underlining is handled, the
  65.  *      input line which is to be underlined, can almost
  66.  *      triple in length.  Unlike normal underlining and
  67.  *      boldfacing, continuous underlining affects all
  68.  *      characters in the buffer, and represents the
  69.  *      worst case condition.  If the distance between
  70.  *      the left margin and the right margin is greater
  71.  *      than about 65 characters, and continuous underlining
  72.  *      is in effect, there is a high probability of buffer
  73.  *      overflow.
  74.  */
  75.  
  76. #define MAXLINE 200
  77. #define PAGELEN  66
  78. #define PAGEWIDTH 80
  79. #define HUGE    256
  80. #define LEFT    0               /* indecies into header margin limit arrays */
  81. #define RIGHT   1
  82. #define NFILES  4               /* nesting depth for input files */
  83.  
  84. /*
  85.  *      The following parameters may be defined in bdscio.h
  86.  */
  87.  
  88. #define YES     1
  89. #define NO      0
  90. #define ERR     -1
  91.  
  92. /*
  93.  *      The parameter values selected for macro definitions
  94.  *      are somewhat arbitrary.  MACBUF is the storage area
  95.  *      for both macro names and definitions.  Since macro
  96.  *      processing is handled by pushing back the expansion
  97.  *      into the input buffer, the longest possible expansion
  98.  *      would be MAXLINE characters.  Allowing for argument
  99.  *      expansion, MXMLEN was chosen slightly less than MAXLINE.
  100.  *      It is assumed that most macro definitions will not
  101.  *      exceed 20 characters, hence MXMDEF of 100.
  102.  */
  103.  
  104. #define MXMDEF  100             /* maximum no. of macro definitions */
  105. #define MACBUF  2000            /* macro definition buffer */
  106. #define MXMLEN  150             /* maximum length of each macro definition */
  107. #define MNLEN   10              /* maximum length of macro name */
  108.  
  109. struct macros {
  110.         char *mnames[MXMDEF];   /* table of pointers to macro names */
  111.         int lastp;              /* index to last mname  */
  112.         char *emb;              /* next char avail in macro defn buffer */
  113.         char mb[MACBUF];        /* table of macro definitions */
  114.         char *ppb;              /* pointer into push back buffer */
  115.         char pbb[MAXLINE];      /* push back buffer */
  116. };
  117.  
  118.  
  119. /* control parameters for nro */
  120.  
  121. struct docctl {
  122.         int fill;       /* fill if YES, init = YES              */
  123.         int lsval;      /* current line spacing, init = 1       */
  124.         int inval;      /* current indent, >= 0, init = 0       */
  125.         int rmval;      /* current right margin, init = 60      */
  126.         int tival;      /* current temp indent, init = 0        */
  127.         int ceval;      /* number of lines to center, init = 0  */
  128.         int ulval;      /* number of lines to underline, init = 0 */
  129.         int cuval;      /* no. lines to continuously underline, init = 0 */
  130.         int juval;      /* justify if YES, init = YES           */
  131.         int boval;      /* number of lines to bold face, init = 0 */
  132.         int bsflg;      /* can output contain '\b', init = FALSE */
  133.         char pgchr;     /* page number character, init = '#'    */
  134.         char cmdchr;    /* command character, init = '.'        */
  135.         int prflg;      /* print on or off, init = TRUE         */
  136.         int sprdir;     /* direction for spread(), init = 0     */
  137.         int flevel;     /* nesting depth for source cmd, init = 0 */
  138.         int nr[26];     /* number registers     */
  139. };
  140.  
  141.  
  142. /* output buffer control parameters */
  143.  
  144. struct cout {
  145.         int outp;       /* next avail char position in outbuf, init = 0 */
  146.         int outw;       /* width of text currently in buffer    */
  147.         int outwds;     /* number of words in buffer, init = 0  */
  148.         int lpr;        /* output to printer, init = FALSE      */
  149.         char outbuf[MAXLINE];   /* output of filled text        */
  150. };
  151.  
  152. /* page control parameters for nro */
  153.  
  154. struct page {
  155.         int curpag;     /* current output page number, init =0  */
  156.         int newpag;     /* next output page number, init = 1    */
  157.         int lineno;     /* next line to be printed, init = 0    */
  158.         int plval;      /* page length in lines, init = 66      */
  159.         int m1val;      /* margin before and including header   */
  160.         int m2val;      /* margin after header                  */
  161.         int m3val;      /* margin after last text line          */
  162.         int m4val;      /* bottom margin, including footer      */
  163.         int bottom;     /* last live line on page
  164.                                         = plval - m3val - m4val */
  165.         int offset;     /* page offset from left, init = 0      */
  166.         int frstpg;     /* first page to print, init = 0        */
  167.         int lastpg;     /* last page to print, init = 30000     */
  168.         int ehlim[2];   /* left/right margins for headers/footers       */
  169.         int ohlim[2];   /* init = 0 and PAGEWIDTH                       */
  170.         int eflim[2];
  171.         int oflim[2];
  172.         char ehead[MAXLINE];    /* top of page title, init = '\n'       */
  173.         char ohead[MAXLINE];
  174.         char efoot[MAXLINE];    /* bottom of page title, init = '\n'    */
  175.         char ofoot[MAXLINE];
  176. };
  177.  
  178. char *getmac();
  179.  
  180.